package com.db.cm.app.service.impl;

import com.db.cm.app.mapper.GoodsMapper;
import com.db.cm.app.model.ClientDO;
import com.db.cm.app.mapper.ClientMapper;
import com.db.cm.app.model.GoodsDO;
import com.db.cm.app.service.ClientService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author YOURSLIHUA
 * @since 2023-11-24
 */
@Service
public class ClientServiceImpl extends ServiceImpl<ClientMapper, ClientDO> implements ClientService {

    @Autowired
    private ClientMapper clientMapper;

    @Override
    public List<ClientDO> selectAll() {
        return clientMapper.selectList(null);
    }
    @Override
    public ClientDO selectById(String clientId) {
        return clientMapper.selectById(clientId);
    }

    @Override
    public boolean update(ClientDO entity) {

        return clientMapper.updateById(entity)>0;
    }

    @Override
    public boolean add(ClientDO entity) {
        return clientMapper.insert(entity)>1;
    }

    @Override
    public boolean delete(ClientDO entity) {
        return clientMapper.deleteById(entity)>0 ;
    }
}
